package eureka.client.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:RenPu
 * @Date: 2020/8/20 15:05
 * @Version: 1.0
 * @description:
 */


@Slf4j
@RestController
public class EurekaClientController {


    @Value("${server.port}")
    private String serverPort;


    @GetMapping("/sayHi")
    public String eurekaClientTest(String test) {

        return "This is +" + serverPort;
    }


    @PostMapping("/sayHi")
    public Firend testPostMethond(@RequestBody Firend firend) {

        log.info("You are my firend" + firend.getName());
        firend.setPort(serverPort);

        return firend;

    }


}
